<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib uri="/WEB-INF/tld/security.tld" prefix="s" %>

<fmt:setBundle basename="messages"/>

<script type="text/javascript" language="javascript">
	var validSubmit = true;
	
	function filterSearchPurchaseOrderVersion(form){								
		if (validSubmit){																		
				form.action = 'filterSearchPurchaseOrderVersionsList.do';
				validSubmit = false;			
				form.submit();
			} else {
				alert('<fmt:message key="warning.message.common.processing"/>');
			}
	}
	
	function submitEditPurchaseOrderVersion(form, purchaseOrderVersionId){
		
		if (validSubmit){
			document.getElementById('selectedPurchaseOrderVersion').value = purchaseOrderVersionId;
			form.action = 'showEditPurchaseOrderVersion.do';
			validSubmit = false;
			
			form.submit();
		} else {
			alert('<fmt:message key="warning.message.common.processing"/>');
		}
	}

	function submitDeletePurchaseOrderVersion(form, purchaseOrderVersionId,shortName){
		if(confirmDelete(shortName)){
			if (validSubmit){
				document.getElementById('selectedPurchaseOrderVersion').value = purchaseOrderVersionId;
				form.action = 'deletePurchaseOrderVersion.do';
				validSubmit = false;
				
				form.submit();
			} else {
				alert('<fmt:message key="warning.message.common.processing"/>');
			}
		}
	}

	function submitPurchaseOrderVersionsQuery(form, orderField, orderType){
		form.orderField.value = orderField;
		form.orderType.value = orderType;
		form.action = "showPurchaseOrderVersionsList.do";

		if (validSubmit){
			form.transportIdFilter.value = document.getElementById('tranportId').value;
			form.transitType.value = document.getElementById('transitId').value;
			form.submit();
		} else {
			alert('<fmt:message key="warning.message.common.processing"/>');
		}
	}
	
	function submitBlockPurchaseOrderVersion( form, purchaseOrderVersionId, purchaseOrderCode ){
		if (validSubmit){
			document.getElementById('purchaseOrderVersionIdBlock').value = purchaseOrderVersionId;
			document.getElementById('purchaseOrderVersionCode').value = purchaseOrderCode;
			validSubmit = false;
			form.submit();
		} else {
			alert('<fmt:message key="warning.message.common.processing"/>');
		}
	}
	
	function submitTagPurchaseOrderVersion( form, purchaseOrderVersionId, purchaseOrderCode ){
		if (validSubmit){
			document.getElementById('purchaseOrderVersionIdTag').value = purchaseOrderVersionId;
			document.getElementById('purchaseOrderTagCode').value = purchaseOrderCode;
			validSubmit = false;
			form.submit();
		} else {
			alert('<fmt:message key="warning.message.common.processing"/>');
		}
	}
	
	function submitSetRegionPurchaseOrderVersion( form, purchaseOrderVersionId, purchaseOrderCode ){
		if (validSubmit){
			document.getElementById('purchaseOrderVersionIdSetRegion').value = purchaseOrderVersionId;
			document.getElementById('purchaseOrderRegionCode').value = purchaseOrderCode;
			validSubmit = false;
			form.submit();
		} else {
			alert('<fmt:message key="warning.message.common.processing"/>');
		}
	}
	
	function validateMonths(id){
		var months = 0;
		var monthsToBal = '';
		monthsToBal = document.getElementById("monthsToBalance");
		if( trim(monthsToBal.value) == '' || parseInt(trim(monthsToBal.value)) == 0 ){
			alert('<bean:message key="label.common.errors"/>:\n<bean:message key="error.message.purchaseorder.version.balance.months.error"/>');
		}else{
			location.href = 'addBalancesToPurchaseOrderVersion.do?purchaseOrderVersionId='+id+'&months=' +monthsToBal.value;
		}
	}

	function selectOption(field){
		var transport = document.getElementById('tranportId');
		var transit = document.getElementById('transitId').value;
		if(transit == 1){					
			transport.selectedIndex = 0;				
			transport.disabled = true;
		}else {
			transport.disabled = false;			
		}			
	}
	
</script>

<form action="filterSearchPurchaseOrderVersionsList.do" method="POST">
<table align="center" width="30%" cellpadding="2" cellspacing="1" border="0" bgcolor="#CCCCC0">            
    <tr>
        <td colspan="5"  class="titulocolumna" align="center">
            <bean:message key="label.purchaseorder.version.name"/>
        </td>        
    </tr>
    <tr>     
    
    	<td class="etiqueta">
            <bean:message key="label.customerfuturepurchase.type.shortName"/>
        </td>
        
        <td class="etiqueta_campo">        
	        <html:select styleId="transitId" name="PurchaseOrderVersionQueryForm" property="transitType" style="width:160px" onchange="selectOption(this);" styleClass="campo_texto">
	            <html:option value="-2"><bean:message key="label.program.purchase.selectanoption"/></html:option>
                <html:option value="-1">Todos</html:option>
                <html:option value="1">Transito</html:option>
                <html:option value="0"><bean:message key="label.versions.purchaseOrders.menu" /> </html:option>
            </html:select>
        </td>           
           
        <td class="etiqueta">
            <bean:message key="label.transports.query.transport"/>
        </td>
        
        <td class="etiqueta_campo">            
			<html:select styleId="tranportId" name="PurchaseOrderVersionQueryForm" property="transportIdFilter" style="width:160px" styleClass="campo_texto">
                <html:option value="-1"><bean:message key="label.program.purchase.selectanoption"/></html:option>
                <html:optionsCollection name="transportListViews" value="transportIdentifier" label="transportDescription"/>
            </html:select>   
        </td>        
        <td align="center" class="columnadatoPar">
         	<input type="submit"  value="<bean:message key="label.common.query"/>"  class="boton"/>
        </td>
    </tr>
</table>
</form>
<br />
 
<table width="100%">
	
	<tr>
		<td>
			<html:form action="/tagDistribution">			
				<html:hidden property="tagDistributionView.purchaseOrderVersionId" styleId="purchaseOrderVersionIdTag"/>
				<html:hidden property="tagDistributionView.purchaseOrderCode" styleId="purchaseOrderTagCode"/>
			</html:form>
			<html:form action="/setRegionDistribution">
				<html:hidden property="setRegionDistributionView.purchaseOrderVersionId" styleId="purchaseOrderVersionIdSetRegion"/>
				<html:hidden property="setRegionDistributionView.purchaseOrderCode" styleId="purchaseOrderRegionCode"/>
			</html:form>
			<html:form action="/blockDistribution">
				<html:hidden property="blockDistributionView.purchaseOrderVersionId" styleId="purchaseOrderVersionIdBlock"/>
				<html:hidden property="blockDistributionView.purchaseOrderCode" styleId="purchaseOrderVersionCode"/>
			</html:form>
			<form name="PurchaseOrderVersionQueryForm" method="POST">
				<input type="hidden" name="purchaseOrderVersionId" id="selectedPurchaseOrderVersion"/>
				<input type="hidden" name="versionId" value="<c:out value="${PurchaseOrderVersionQueryForm.versionId}"/>"/>
				<input type="hidden" name="orderField"/>
				<input type="hidden" name="orderType"/>
				<input type="hidden" name="transportIdFilter"/>
				<input type="hidden" name="transitType"/>
				<table align="center" width="930" cellpadding="2" cellspacing="1" border="0" bgcolor="#CCCCC0">			
					<tr>
						<td colspan="17" align="right" class="titulo_lista_interna">		
						 <b><bean:message key="label.purchaseorder.months.credit.line"/></b>&nbsp;&nbsp;<input type="text"  name="monthsToBalance"  id="monthsToBalance" size="5" class="columnanumero" maxlength="5" value="<bean:write name="PERIODS_NUMBER_PO_IN_BALANCES" property="value"/>" onfocus="this.select();" onkeydown="return (numeric(event, 1) && noPaste(event, this));" onkeyup="extractNumber(this,2,false);">
						</td>
					</tr>
					<tr>					
						<td width="30" class="titulocolumna" align="center">
							<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="NEW" permiso="ADMINISTRACION">
								<a href="showAddPurchaseOrderVersion.do?versionId=<c:out value="${PurchaseOrderVersionQueryForm.versionId}"/>">
									<img alt="<bean:message key="common.add"/> <bean:message key="label.purchaseorder.version.name"/>" src="images/nuevo.gif" border="0"/>
								</a>
							</s:entidad>
						</td>
						<td width="140" class="titulocolumna" align="center">
							<a href="#>" onclick="submitPurchaseOrderVersionsQuery(PurchaseOrderVersionQueryForm, 1, '<c:choose><c:when test="${previousOrderField == 1 && previousOrderType == 0}">1</c:when><c:otherwise>0</c:otherwise></c:choose>');"class="ligas">
								<fmt:message key="label.purchaseorder.version.period"/>
								<c:choose>
									<c:when test="${previousOrderField == 1 && previousOrderType == 1}">
										<img alt="<fmt:message key="label.common.order.ascending"/>" src="images/arrow_up.gif" border="0"/>
									</c:when>
									<c:when test="${previousOrderField == 1 && previousOrderType == 0}">
										<img alt="<fmt:message key="label.common.order.descending"/>" src="images/arrow_down.gif" border="0"/>
									</c:when>
								</c:choose>
							</a>
						</td>
						<td width="100" class="titulocolumna" align="center">
							<a href="#>" onclick="submitPurchaseOrderVersionsQuery(PurchaseOrderVersionQueryForm, 2, '<c:choose><c:when test="${previousOrderField == 2 && previousOrderType == 0}">1</c:when><c:otherwise>0</c:otherwise></c:choose>');"class="ligas">
								<fmt:message key="label.purchaseorder.version.code"/>
								<c:choose>
									<c:when test="${previousOrderField == 2 && previousOrderType == 1}">
										<img alt="<fmt:message key="label.common.order.ascending"/>" src="images/arrow_up.gif" border="0"/>
									</c:when>
									<c:when test="${previousOrderField == 2 && previousOrderType == 0}">
										<img alt="<fmt:message key="label.common.order.descending"/>" src="images/arrow_down.gif" border="0"/>
									</c:when>
								</c:choose>
							</a>
						</td>
						<td width="50" class="titulocolumna" align="center">
							<a href="#>" onclick="submitPurchaseOrderVersionsQuery(PurchaseOrderVersionQueryForm, 3, '<c:choose><c:when test="${previousOrderField == 3 && previousOrderType == 0}">1</c:when><c:otherwise>0</c:otherwise></c:choose>');"class="ligas">
								<fmt:message key="label.purchaseorder.version.plant"/>
								<c:choose>
									<c:when test="${previousOrderField == 3 && previousOrderType == 1}">
										<img alt="<fmt:message key="label.common.order.ascending"/>" src="images/arrow_up.gif" border="0"/>
									</c:when>
									<c:when test="${previousOrderField == 3 && previousOrderType == 0}">
										<img alt="<fmt:message key="label.common.order.descending"/>" src="images/arrow_down.gif" border="0"/>
									</c:when>
								</c:choose>
							</a>
						</td>
						<td width="70" class="titulocolumna" align="center">
							<a href="#>" onclick="submitPurchaseOrderVersionsQuery(PurchaseOrderVersionQueryForm, 4, '<c:choose><c:when test="${previousOrderField == 4 && previousOrderType == 0}">1</c:when><c:otherwise>0</c:otherwise></c:choose>');"class="ligas">
								<fmt:message key="label.purchaseorder.version.tons"/>
								<c:choose>
									<c:when test="${previousOrderField == 4 && previousOrderType == 1}">
										<img alt="<fmt:message key="label.common.order.ascending"/>" src="images/arrow_up.gif" border="0"/>
									</c:when>
									<c:when test="${previousOrderField == 4 && previousOrderType == 0}">
										<img alt="<fmt:message key="label.common.order.descending"/>" src="images/arrow_down.gif" border="0"/>
									</c:when>
								</c:choose>
							</a>
						</td>
						<td colspan="3" class="titulocolumna" align="center">
							<bean:message key="label.purchaseorder.varsion.draft"/>
						</td>						
						<td colspan="3" width="220" class="titulocolumna" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<bean:message key="label.purchaseorder.varsion.blocked"/></td>
						<td colspan="3" width="130" class="titulocolumna" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<bean:message key="label.purchaseorder.varsion.tagged"/></td>
						<td colspan="2" width="70" class="titulocolumna" align="left">&nbsp;&nbsp;&nbsp;&nbsp;<bean:message key="label.purchaseorder.varsion.region"/></td>						
						<td width="30" class="titulocolumna" align="center">&nbsp;</td>
					</tr>
					<c:forEach items="${purchaseOrderVersions}" var="purchaseOrderVersion" varStatus="status">
						<tr class="<c:choose><c:when test="${ purchaseOrderVersion.purchaseOrderVersionId ==0}"><c:out value="columnadatoNon" /></c:when><c:otherwise><c:choose><c:when test="${ purchaseOrderVersion.transportId == null}"><c:out value="columnaAmarilla" /></c:when><c:otherwise><c:choose><c:when test="${status.index%2 == 0}"><c:out value="columnadatoPar" /></c:when><c:otherwise><c:out value="columnadatoNon" /></c:otherwise></c:choose></c:otherwise></c:choose></c:otherwise></c:choose>">
							<c:choose>
								<c:when test="${purchaseOrderVersion.purchaseOrderVersionId==0}">
									<td colspan="4" align="right">
										<b><bean:message key="label.purchaseorder.version.tons.total"/>:</b>&nbsp;
									</td>
								</c:when>
								<c:otherwise>
									<td valign="top" align="center">
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="EDIT" permiso="ADMINISTRACION">
											<a href="#>" onclick="submitEditPurchaseOrderVersion(PurchaseOrderVersionQueryForm, '<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>');">
												<img alt="<fmt:message key="common.edit"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/modificar.gif" border="0"/>
											</a>
										</s:entidad>
									</td>
									<td valign="top" align="center">
										<c:out value="${purchaseOrderVersion.biWeekPeriodVersionView.biWeekView.description}"/>
									</td>
									<td valign="top" align="center">
										<c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>
									</td>
									<td valign="top" align="center">
										<c:out value="${purchaseOrderVersion.plantView.shortName}"/>
									</td>
								</c:otherwise>
							</c:choose>
							<td valign="top" align="right">
								<c:if test="${purchaseOrderVersion.capacity != 0.0}">
									<fmt:formatNumber pattern="###,###,##0.00" type="number" maxFractionDigits="3" minFractionDigits="3" value="${purchaseOrderVersion.capacity}"/>
								</c:if>
							</td>
							<c:choose>
								<c:when test="${purchaseOrderVersion.purchaseOrderVersionId==0}">
									<td colspan="12">
										&nbsp;
									</td>
								</c:when>
								<c:otherwise>
									<td valign="top" align="center" width="20">
										<c:if test="${!purchaseOrderVersion.transit}">
											<c:if test="${purchaseOrderVersion.applyBalance != 0}">
												<c:out value="${purchaseOrderVersion.applyBalance}"/>
											</c:if>
										</c:if>
									</td>
									<td valign="top" align="center" width="20">
										<c:if test="${!purchaseOrderVersion.transit}">
											<c:if test="${purchaseOrderVersion.applyBalance == 0}">
												<a href="#>" onclick="validateMonths(<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>);">
													<img alt="<fmt:message key="common.add"/> <fmt:message key="menu.module.balance"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/occonfig_add.png" border="0">
												</a>
											</c:if>
										</c:if>
									</td>	
									<td valign="top" align="center" width="20">
										<c:if test="${!purchaseOrderVersion.transit}">
											<c:if test="${purchaseOrderVersion.applyBalance != 0}">
												<a href="#>"  onclick="if(confirmDelete('<bean:message key="label.breadcrum.purchaseorder.version.balance"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>'))location.href = 'deleteBalancesToPurchaseOrderVersion.do?purchaseOrderVersionId=<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>'">
													<img alt="<fmt:message key="common.delete"/> <fmt:message key="menu.module.balance"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/occonfig_delete.png" border="0">
												</a>
											</c:if>
										</c:if>
									</td>								
									<td width="150" align="right" valign="top">
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<logic:present name="purchaseOrderVersion" property="blockDistributionView">
												<bean:write name="purchaseOrderVersion" property="blockDistributionView.finishBlockPeriodDescription"/> - <bean:write name="purchaseOrderVersion" property="blockDistributionView.startBlockPeriodDescription"/> (<bean:write name="purchaseOrderVersion" property="blockDistributionView.quantity"/> )
											</logic:present>
										</s:entidad>
									</td>
									<td width="20"  valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<a href="#>" onclick="submitBlockPurchaseOrderVersion(BlockDistributionForm, '<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>', '<c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>');">
												<img alt="<logic:present name="purchaseOrderVersion" property="blockDistributionView"><fmt:message key="common.edit"/></logic:present><logic:notPresent name="purchaseOrderVersion" property="blockDistributionView"><fmt:message key="common.add"/></logic:notPresent> <fmt:message key="common.block"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="<logic:present name="purchaseOrderVersion" property="blockDistributionView">images/occonfig_edit.png</logic:present><logic:notPresent name="purchaseOrderVersion" property="blockDistributionView">images/occonfig_add.png</logic:notPresent>" border="0"/>
											</a>
										</s:entidad>
									</td>
									<td width="20" valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<logic:present name="purchaseOrderVersion" property="blockDistributionView">
												<a href="#>" onclick="if( confirmDelete('<bean:message key="label.breadcrum.purchaseorder.version.block"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>'))location.href='blockDistributionDelete.do?purchaseOrderVersionId=<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>'">
													<img alt="<fmt:message key="common.delete"/> <fmt:message key="common.block"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/occonfig_delete.png" border="0"/>
												</a>
											</logic:present>
										</s:entidad>
									</td>
									<td width="90" valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<logic:present name="purchaseOrderVersion" property="tagDistributionView">
												<logic:iterate id="plantas" name="purchaseOrderVersion" property="tagDistributionView.tagPlantDistributionViews">
													<logic:notEqual name="plantas" property="totalQuantity" value="0">
														<bean:write name="plantas" property="plantView.shortName"/> - <bean:write name="plantas" property="totalQuantity"/><br/>
													</logic:notEqual>
												</logic:iterate>
											</logic:present>
										</s:entidad>
									</td>
									<td width="20" valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<a href="#>" onclick="submitTagPurchaseOrderVersion(TagDistributionForm, '<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>', '<c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>');">
												<img alt="
														<logic:notEqual name="purchaseOrderVersion" property="tagDistributionView.totalDistribution" value="0">
															<fmt:message key="common.edit"/>
														</logic:notEqual>
														<logic:equal name="purchaseOrderVersion" property="tagDistributionView.totalDistribution" value="0">
															<fmt:message key="common.add"/>
														</logic:equal>
														<fmt:message key="common.tag"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" 
													src="
														<logic:notEqual name="purchaseOrderVersion" property="tagDistributionView.totalDistribution" value="0">
															images/occonfig_edit.png
														</logic:notEqual>
														<logic:equal name="purchaseOrderVersion" property="tagDistributionView.totalDistribution" value="0">
															images/occonfig_add.png
														</logic:equal>
														" border="0"/>
											</a>
										</s:entidad>
									</td>
									<td width="20" valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<logic:notEqual name="purchaseOrderVersion" property="tagDistributionView.totalDistribution" value="0">
												<a href="#>" onclick="if( confirmDelete('<bean:message key="label.breadcrum.purchaseorder.version.tag"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>'))location.href='tagDistributionAllDelete.do?purchaseOrderVersionId=<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>'">
													<img alt="<fmt:message key="common.delete"/> <fmt:message key="common.tag"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/occonfig_delete.png" border="0"/>
												</a>
											</logic:notEqual>
										</s:entidad>
									</td>
									<td width="50" valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<logic:present name="purchaseOrderVersion" property="setRegionDistributionView">
												<bean:write name="purchaseOrderVersion" property="setRegionDistributionView.regionCode"/>
											</logic:present>
										</s:entidad>
									</td>
									<td width="20" valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="CONFDIST" permiso="ADMINISTRACION">
											<a href="#>" onclick="submitSetRegionPurchaseOrderVersion(SetRegionDistributionForm, '<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>', '<c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>');">
												<img alt="<fmt:message key="common.edit"/> <fmt:message key="common.region"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/occonfig_edit.png" border="0"/>
											</a>
										</s:entidad>
									</td>
									<td valign="top" >
										<s:entidad nombreCortoMod="PROC" nombreCortoSub="VERPURPR" nombreCortoEnt="DELETE" permiso="ADMINISTRACION">
											<a href="#>" onclick="submitDeletePurchaseOrderVersion(PurchaseOrderVersionQueryForm, '<c:out value="${purchaseOrderVersion.purchaseOrderVersionId}"/>','<c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>');">
												<img alt="<fmt:message key="common.delete"/> <c:out value="${purchaseOrderVersion.code}"/><c:out value="${purchaseOrderVersion.postFix}"/>" src="images/eliminar.jpg" border="0"/>
											</a>
										</s:entidad>
									</td>
								</c:otherwise>
							</c:choose>
						</tr>
					</c:forEach>
				</table>
			</form>
		</td>
	</tr>
</table>
<br/>
<table width="70%" align="center" cellpadding="2" cellspacing="1" border="0" bgcolor="#CCCCC0">
	<tr>		
		<td align="center" class="titulo_lista_interna">			
			<html:button property="back" onclick="location.href ='showVersionDetail.do'" styleClass="boton"><bean:message key="label.common.back"/></html:button>
		</td>
	</tr>
</table>
<br />
<br />